import express from 'express';
import * as adminController from './admin.controller';
import { validateAdminData, hashPassword } from './admin.middleware';

const router = express.Router();

/**
 * 获取管理员
 */
router.get('/admin', adminController.index);

/**
 * 创建管理员
 */
router.post('/admin', validateAdminData, hashPassword, adminController.store);

/**
 * 修改状态
 */
router.patch('/adminStatus', adminController.status);

/**
 * 删除内容
 */
router.delete('/admin/:postId', adminController.destroy);

/**
 * 导出路由
 */
export default router;
